﻿@{
    ViewBag.Title = "RandNumAndStr";
    Layout = "~/Views/Shared/_Page.cshtml";
}

<h2>Rand Number And String</h2>

<script type="text/javascript">
   
    window.onload = function() {
        var rand1 = Math.floor(Math.random() * 10); // 0 to 9
        var rand2 = Math.ceil(Math.random() * 6);   // 1 to 6

        ZEUS.DEBUG.log("Math.floor(Math.random() * 10): " + rand1);
        ZEUS.DEBUG.log("Math.ceil(Math.random() * 6): " + rand2);

        var people = ['Ron', 'Sally', 'Tricia', 'Bob', 'David', 'Kelvin']; //create an array
        var randIdx = Math.floor(Math.random() * people.length);
        var rndPerson = people[randIdx];

        ZEUS.DEBUG.log("people = " + people);
        ZEUS.DEBUG.log("rand person = " + rndPerson);
    }

</script>
